<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>添加操作员用户</title>
<script type="text/javascript">

sfAutoEmail.email({
	mailList:["@qq.com","@163.com","@126.com","@wcfsy.com","@wcfsy.com"]
});
var myDialog;
 
	$(function(){
		$("#userForm").validator({validInHidden:true},{
			callback:function(results){
				$("#userForm").ajaxSubmit(function(data){
			       	 myDialog =  art.dialog({icon: data.success,content: data.message,lock:true});
			       	 if(data.success == 'succeed'){
			       		 $("#userForm").resetForm();
			       	 }
				});
			}
		});
	});
	 
	 
	function checkUserName() {
		var result = new Object();
		result.result = false;
		result.msg = "";
		$.ajax({
			type : "POST",
			url : CONTEXT_PATH + "/cms/operator/username/check",
			data : {"userName" : $("#userName").val()},
			async : false,
			success : function(data) {
				if (data.success == "succeed") {
					result.result = true;
					result.msg = data.message;
				} else {
					result.result = false;
					result.msg = data.message;
				}
			}
		});
		return result;
	}

</script>
</head>
<body>
	<div class="modal">
		<div class="modal-header r_location">
			<i class="r_txtico"></i> 运营管理 &gt; 操作员管理 &gt; 添加操作员
		</div>
		<div class="modal-body">
			<form id="userForm" method="post"  name="iform" action="cms/operator/add">
				<ul class="all_list">
          <li><span class="all_title">用户名：</span><span>
            <input id="userName" type="text"  value="<c:out value="${userName}"/>" validator='{"label":"用户名","minLength":6,"maxLength":18,"customFun":"checkUserName"}' name="userName" class="ui_input"/> 
            </span>
             <br/><span class="all_title"></span><span>（ 密码和用户名相同,请通知用户及时修改密码）</span>
            </li>
          <li><span class="all_title">真实姓名：</span><span>
           <input id="realName" type="text" validator='{"label":"真实姓名","isChinOrEng":true,"maxLength":20}' value="<c:out value="${realName}"/>"
								name="realName" class="ui_input"/>
            </span></li>
          <li><span class="all_title">联系电话：</span><span>
            <input id="telephone" type="text" validator='{"label":"联系电话","txtType":"phone"}' value="<c:out value="${telephone}"/>"
								name="telephone" class="ui_input"/>
            </span></li>
          <li> <span class="all_title">邮箱：</span><span>
           <input id="email" type="text" value="<c:out value="${email}"/>" name="email" validator='{"label":"邮箱","txtType":"xn-email"}' class="ui_input fn-email"/>
            </span>
             </li>
			<li><span class="all_title">备注：</span>
			<span><textarea id="remark" name="remark" style="width: 163px; height: 84px;" validator='{"label":"备注","maxLength":500,"required":false}'><c:out value="${remark}"/></textarea></span>
			</li>
          <li class="m-t10"><span class="all_title"></span><span>
		  <shiro:hasPermission name="operator:add"><input type="button" id="addButton" name="addButton"  value="提 交" class="submit_btn submitBtn">
            </shiro:hasPermission></span></li>
        </ul>
			</form>
		</div>
	</div>
</body>
</html>